package com.example.bookstore.mapper;

import com.example.bookstore.entity.Order;
import com.example.bookstore.vo.ResultVO;
import org.apache.ibatis.annotations.Mapper;
import org.aspectj.weaver.ast.Or;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface OrderMapper {

    //创建一个新的订单
    Integer InsertOrder(Order order);

    //删除一个订单
    Integer DeleteOrder(Integer orderId);

    //更新支付状态
    Integer UpdatePayState(Integer orderId);

    //根据id精确查询订单
    Order SelectOrderById(Integer orderId);

    //根据用户查询所有订单
    List<Order> SelectOrderByUser(Integer userId);

    //筛选出本周内的订单,并且计算前三名最热畅销
    List<Order> ShowAllOrderByWeek();

}